import { defineStore } from "pinia";
import { ref } from "vue";
import type { EmpRspLogin } from "../model";
// import type { UserRsp } from "../model";

// export const useUserStore = defineStore("user", () => {
//     const userInfo = ref<UserRsp | null>(null);
//     function setUserInfo(uInfo: UserRsp | null) {
//       userInfo.value = uInfo;
//     }
//     return { userInfo, setUserInfo };
//   },
//   {
//     persist: true,
//   }
// );
export const useEmpStore = defineStore("emp",()=>{
  const empInfo = ref<EmpRspLogin | null>(null);
  function setEmpInfo(eInfo : EmpRspLogin | null) {
    empInfo.value = eInfo;
  }

  return { 
    empInfo,
    setEmpInfo
   }
},{
  persist: {
    storage: sessionStorage
  }
})
